// 复用的接口

//登录type
export interface LoginType {
  username: string,
  password: string
}

// 分页
export interface MetaType {
  currentPage: number,
  lastPage: number,
  perSize: number,
  total: number
}

// 权限
export interface JurisdictionType {
  id: string,
  name: string,
}

//用户body
export interface UserBodyType {
  username: string,
  password?: string,
  jurisdiction: string[]
}

// 个人信息type
export interface InfoType {
  id: string,
  username: string,
  jurisdictions: Array<{
    id: string,
    name: string,
    english_name: string
  }>,
  created_at: number,
  lasted_at: number,
}

//字典分类
export interface DictCategoryType {
  id: string,
  type_id: string,
  name: string,
  created_at: number,
  updated_at: number,
  key?: string,
  child?: Array<{
    id: string,
    type_id: string,
    name: string
  }>
}

//弹窗控制type
export interface ModalType {
  title: string,
  visible: boolean
}

//字典请求体
export interface DictBodyType {
  name: string,
  type_id: string
}


//文献表单
export interface LiteratureFormType {
  name: string,
  author: string,
  press: string,
  introduce: string,
  code: number,
  cover_id: string,
  file_id: string,
  category_id: string
}

// 文献table数据
export interface LiteratureDataType {
  id: string,
  // 添加唯一标识
  key: string,
  // 封面地址
  cover_url: string,
  cover: {
    id: string,
    path: string,
    type: string
  },
  file: {
    id: string,
    path: string,
    type: string
  },
  // 文件地址
  file_url: string
  // 文獻名字
  name: string,
  // 作者
  author: string,
  // 字典分类
  category_id: string,
  // 出版社
  press: string
  // 文件格式
  file_type: string,
  // 阅读树
  read: number,
  // 推荐
  recommend: number,
  // 是否上架
  grounding: number
  // 编号
  code: string,
  // 阅读树
  visit_num: number,
  dict: {
    type_id: string,
    name: string
  }
}

//文章表格数据类型
export interface ArticleDataType {
  id: string,
  // 添加唯一标识
  key: string,
  name: string,
  // 編輯者
  username: string,
  // 内容
  content: string,
  // 封面id
  cover_id: string,
  // 封面详情
  cover: {
    id: string,
    path: string,
    type: string
  },
  // 封面地址
  cover_url: string,
  // 推荐
  recommend: number,
  // 是否上架
  grounding: number,
  // 所属区域id
  region_id: string,
  // 所属区域信息
  region: {
    id: string,
    name: string
  },
  region_name: string,
  // 阅读树
  visit_num: number,
  category_id: string
  dict: {
    type_id: string,
    name: string
  }
}

export interface ArticleFormType {
  name: string,
  username: string,
  content: string,
  cover_id: string,
  category_id: string
}

//区域详情type
export interface RegionType {
  id: string,
  name: string,
  videos: Array<{
    id: string,
    path: string,
    type: string
  }>,
  images: Array<{
    id: string,
    path: string,
    type: string
  }>,
  category_id: string,
  content: string
}
